/**
 * Created by Administrator on 2017/12/18 0018.
 */
define(['jquery','bbcare','scprit/patientsQuestionnaire/vm/common.js'],function($,$bb,$common){
    var servers = {};
    var URL = $bb.baseUrl("followup");
    /*
     * 获取问卷：
     * */
    servers.getQuestion = function(params,callback,otherParams){
        $common.ajax({
            url: URL + "followup/webapi/service/evaluation/getAllPostion",
            data: JSON.stringify({
                "data": {
                    "channel": "BBCARE-APP",
                    "queueId": params.queueId,
                    "evaluationType": params.evaType ,//或者 "OSI","LES"
                    "userId": params.userId,
                    "deptId": params.deptId
                }
            }),
            success: function (data) {
                callback(data,otherParams)
            }
        });
    };

    /*
    * 保存问卷：
    * */
    servers.saveQuestion = function(params,callback,otherParams){
        $common.ajax({
            url: URL + "followup//webapi/service/evaluation/getScore",
            data: JSON.stringify({
                "data": {
                    "channel": "BBCARE-APP",
                    "queueId": params.queueId,
                    "deptId": params.deptId,
                    "evaluationType": params.examinationPaperName,//OSI
                    "postionIds": params.postionIds,
                    "userId": params.userId,
                    "postionScores": params.postionScores
                }
            }),
            success: function (data) {
                callback(data,otherParams)
            }
        });
    };
    return servers;
});
